<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>巫谢的博客</title>
    <!--
    <link rel="stylesheet" href="/Public/bootstrap/css/bootstrap.min.css">
    <script src="/Public/bootstrap/scripts/jquery.min.js"></script>
    <script src="/Public/bootstrap/js/bootstrap.min.js"></script>
    -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    <script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <link href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://pingendo.github.io/pingendo-bootstrap/themes/default/bootstrap.css" rel="stylesheet" type="text/css">-->
    <script type="text/javascript" src="/Public/js/jquery.min.js"></script>
    <script type="text/javascript" src="/Public/js/bootstrap.min.js"></script>
    <link href="/Public/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/Public/css/bootstrap.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="section">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h1 class="text-left">巫谢的博客</h1>
                <ul class="text-right">
                    <li>欢迎您：<?php echo ($admin_name); ?></li>
                    <li><a href="/" target="_blank">前台首页</a></li>
                    <li><a href="<?php echo U('Login/logout');?>">退出登录</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class="section">
    <div class="container">
        <div class="row">
            <div class="col-md-2">
                <p>菜单</p>
                <ul class="nav nav-pills nav-stacked">
                    <li><a href="<?php echo U('Index /index');?>">后台首页</a></li>
                    <li><a href="#">新增博文</a></li>
                    <li><a href="<?php echo U('Blog/index');?>">博文列表</a></li>
                    <li><a href="<?php echo U('Category/add');?>">新增分类</a></li>
                    <li><a href="<?php echo U('Category/index');?>">分类列表</a></li>
                    <li><a href="#">回收站</a></li>
                </ul>
            </div>
            <div class="col-md-10">
                <div>博文列表</div>
<div class="top-button">
    选择商品分类：<select id="category">
    <option value="-1" >全部</option>
    <option value="0" <?php if(($cid) == "0"): ?>selected<?php endif; ?>>未分类</option>
    <?php if(is_array($category)): foreach($category as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>" <?php if(($v["id"]) == $cid): ?>selected<?php endif; ?>><?php echo str_repeat('— ',$v['level']); echo ($v["name"]); ?></option><?php endforeach; endif; ?>
</select>
    <a href="<?php echo U('Goods/add',array('cid'=>$cid));?>" class="light">添加商品</a>
    <a href="<?php echo U('Category/add');?>">添加分类</a>
</div>
<div class="list full">
    <table>
        <tr><th class="t1">博文分类</th><th>博文名称</th> <th width="60">推荐</th><th width="120">操作</th></tr>
        <?php if(is_array($blog["data"])): foreach($blog["data"] as $key=>$v): ?><tr><td>
                <?php if(empty($v["category_id"])): ?><a href="<?php echo U('Blog/index','cid=0');?>">未分类</a>
                    <?php else: ?>
                    <a href="<?php echo U('Blog/index',array('cid'=>$v['category_id']));?>"><?php echo ($v["category_name"]); ?></a><?php endif; ?>
            </td>
                <td><?php echo ($v["name"]); ?></td><td><?php echo ($v["stock"]); ?></td>
                <td><a href="#" class="act-onsale" data-id="<?php echo ($v["id"]); ?>" data-status="<?php echo ($v["on_sale"]); ?>"><?php if(($v["on_sale"]) == "yes"): ?>是<?php else: ?>否<?php endif; ?></a></td>
                <td><a href="#" class="act-recommend" data-id="<?php echo ($v["id"]); ?>" data-status="<?php echo ($v["recommend"]); ?>"><?php if(($v["recommend"]) == "yes"): ?>是<?php else: ?>否<?php endif; ?></a></td><td>
                    <a href="<?php echo U('Blog/edit',array('id'=>$v['id'],'cid'=>$v['category_id'],'p'=>$p));?>">修改</a>　<a href="#" class="act-del" data-id="<?php echo ($v["id"]); ?>">删除</a></td></tr><?php endforeach; endif; ?>
    </table>
</div>
<div class="pagelist"><?php echo ($goods["pagelist"]); ?></div>
            </div>
        </div>
    </div>
</div>
<footer class="section section-primary">
    <div class="container">

    </div>
</footer>
</body>
</html>